#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
void print(int  val)
{
	cout<<val<<endl;
}

int main(int argc, char const *argv[])
{
	vector<int> v;
	v.push_back(10);
	v.push_back(10);
	v.push_back(10);
	v.push_back(10);
	v.push_back(10);
	v.push_back(10);
	v.push_back(10);
	v.push_back(10);

	// 通过迭代器访问
	// vector<int>::iterator begin = v.begin();
	// vector<int>::iterator end = v.end();
	// while(begin != end)
	// {
	// 	cout<<*begin<<endl;
	// 	begin++;
	// }
	// cout<<endl;

	// for (vector<int>::iterator b = v.begin();b != v.end(); ++b)
	// 	cout<<*b<<endl;

	for_each(v.begin(), v.end(), print);

	return 0;
}